home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / git-4.3 / git-4 / git-4.3.11 / src / .gitaction next >
Encoding:
Text File  |  1996-04-01  |  1.2 KB  |  40 lines

  1. #!/bin/sh
  2.  
  3. ###############################################################################
  4. ###                                        ###
  5. ###        GNU Interactive Tools 4.3.10 per file type action script        ###
  6. ###                Local version                    ###
  7. ###   Copyright (c) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.   ###
  8. ###            Written by Tudor Hulubei and Andrei Pitis.            ###
  9. ###                                        ###
  10. ###############################################################################
  11.  
  12. #
  13. # This script executes a different action for each file type specified.
  14. # The script tries to match the second parameter against the patterns
  15. # specified in the 'case' statement (see below).
  16. # If you want to add new file types & actions to this script, just add a
  17. # new entry to the 'case' statement *before* the last one ( *) ... )
  18. #
  19. # For grater flexibility, .gitaction's first parameter is the name of the
  20. # directory where the file resides. So, you can get the complete file
  21. # name appending the file base name to the file path just like that: $1/$2
  22. #
  23.  
  24. name=`basename $0`
  25.  
  26. if test "$#" -ne 2 -o ! -d "$1" -o ! -f "$2"; then
  27.     echo "$name: GIT internal script" >&2
  28.     exit 1
  29. fi
  30.  
  31. done=1
  32.  
  33. case $2 in
  34. *.foo)  ls -la $2;;
  35. *.bar)  $GIT_PAGER $2;;
  36. *)      done=0
  37. esac
  38.  
  39. exit $done
  40.